package com.ttn.common.core.entity.business;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 订单表
 */
@Data
@Accessors(chain = true)
@TableName(value = "order_management")
public class Order implements Serializable {
    private static final long serialVersionUID = 2323490416319722165L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单编号
     */
    @TableField(value = "order_number")
    private String orderNumber;

    /**
     * 订单状态(0未支付 1已支付 3已取消 4 退款中 5已退款)
     */
    @TableField(value = "order_status")
    private Integer orderStatus;

    /**
     * 支付时间
     */
    @TableField(value = "payment_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8" )
    private Date paymentTime;

    /**
     * 应付金额(单位分)
     */
    @TableField(value = "amounts_payable")
    private Integer amountsPayable;

    /**
     * 优惠金额(单位分)
     */
    @TableField(value = "discounted_price")
    private Integer discountedPrice = 0;
    /**
     * 支付方式(1微信 2支付宝 3手动创建)
     */
    @TableField(value = "payment_method")
    private Integer paymentMethod;

    /**
     * 学员id
     */
    @TableField(value = "student_id")
    private Integer studentId;

    /**
     * 产品id
     */
    @TableField(value = "product_id")
    private Integer productId;

    /**
     * 产品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 产品类型(1体验2正式)
     */
    @TableField(value = "product_type")
    private Integer productType;

    /**
     * 产品价格(单位分)
     */
    @TableField(value = "product_price")
    private Integer productPrice;

    /**
     * 服务期(天)
     */
    @TableField(value = "service_period")
    private Integer servicePeriod;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8" )
    private LocalDateTime createTime;

    /**
     * 退款时间
     */
    @TableField(value = "refund_time")
    private LocalDateTime refundTime;
    /**
     * 创建时间
     */
    @TableField(value = "out_trade_no")
    private String outTradeNo;


}